<?php
class cls_serve_discount extends cls_serve_base
{
	function get_discount_list($page,$rp,$where,$sort)
	{
		$discount_data = parent::get_data();
		$discount_list = $discount_data->get_discount_list($page,$rp,$where,$sort);
		return $discount_list;
		
	}
	
	function delete_discount($items)
	{
		$discount_delete = parent::get_data();
		$discount_delete->delete_discount($items);
	}
	
	
	
	function add_discount($items)
	{
		$discount_add = parent::get_data();
		$discount_add->add_discount($items);		
	}
	
	function product_add_discount($items)
	{
		$product_discount_add = parent::get_data();
		$product_discount_add->product_add_discount($items);
	}
	
	function getCount($where,$tablename,$table2)
	{
		$discount_data = parent::get_data();
		if(!$table2)
		$count = $discount_data->countRec('id',$where,$tablename);
		else 
			$count = $discount_data->countRec('dp.id',$where,$tablename,$table2);
		return $count;
	}
	
	function modify_discount($items)
	{
		$modify_discount = parent::get_data();
		$modify_discount->modify_discount($items);
		
		
	}
	
    function get_discount_product($page,$rp,$where,$sort)
    {
    	
    	$discount_data = parent::get_data();
    	$discount_product = $discount_data->get_discount_product($page,$rp,$where,$sort);
    	return $discount_product;
    	
    }

}